package com.gulimall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.common.to.OrderTo;
import com.common.to.WareLockTo;
import com.common.to.mq.StockLockedTo;
import com.common.utils.PageUtils;
import com.gulimall.ware.entity.WareOrderTaskDetailEntity;
import com.gulimall.ware.entity.WareOrderTaskEntity;
import com.gulimall.ware.entity.WareSkuEntity;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author Rookie-886
 * @email ${email}
 * @date 2021-03-14 22:37:36
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum);

    Map<Long, Integer> getStockList(List<Long> skuIdList);

    Boolean wareLock(WareLockTo wareLockTo);

    void releaseStock(WareOrderTaskEntity wareOrderTaskEntity, WareOrderTaskDetailEntity taskDetailEntity, Message message, Channel channel) throws IOException;

}

